Skip to main content

sum

sum(input: any[] | Mat | Tensor | Number) : any[] | Mat | Tensor | Number

param input the list, vector, matrix, javascript array, or tensor, or even number to sum up the elements of

returns: Number - A number which is the sum of all the elements of each entry in the structure input

This function simply adds up, or sums all elements of a given structure and returns that sum: